package org.uni_hi.lsep.text;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;

public class ChapterNode {
	
	public enum NodeType{TEXT,QUIZ,DRAGDROP,SIM,FREESIM};
	
	private URI _uri=null;
	private String _title=null;
	private boolean _isTest=false;
	private NodeType _type=null;
	
	public ChapterNode(URI f){
		this(f,"Not defined");
	}
	
	public ChapterNode(URI f, String title){
		this(f,title,false);
	}
	
	public ChapterNode(URI f, String title, boolean isTest){
		this(f, title, isTest, null);
	}
	
	public ChapterNode(URI f, String title, boolean isTest, NodeType type){
		_uri=f;
		_title=title;
		_isTest=isTest;
		_type=type;
	}

	public URL getURL() throws MalformedURLException{
		return _uri.toURL();
	}
	
	public boolean isTest(){
		return _isTest;
	}
	
	public String toString(){
		return _title;
	}	
	
	public NodeType getNodeType(){
		return _type;
	}
}
